from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware

from routers import ws, test

app = FastAPI()

origins = ["*"]

app.add_middleware(
    CORSMiddleware,
    allow_origins=origins,
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

app.include_router(ws.router)
app.include_router(test.router)


@app.get('/')
async def root():
    return {"message": "Hello world"}
